package com.example.menglinhe.yuejian308.model;

import com.example.menglinhe.yuejian308.bean.LoginBean;
import com.example.menglinhe.yuejian308.service.YuejianService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;


import static com.example.menglinhe.yuejian308.finalclass.Yuejian.URL;




public class LoginModel {
    private Retrofit retrofit;

    public LoginModel() {
        retrofit = new Retrofit.Builder()
                .addConverterFactory(GsonConverterFactory.create())
                .baseUrl(URL)
                .build();

    }


    public Call<LoginBean> checkLogin(String phone, String password) {  //登录
        YuejianService service = retrofit.create(YuejianService.class);
        Retrofit retrofit = new Retrofit.Builder()
                .addConverterFactory(GsonConverterFactory.create())
                .baseUrl(URL)
                .build();
        return service.login(phone, password);
    }


}
